package com.donglijiedian.CollectionTest;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.util.Objects;

/**
 * @Author xiao hu die
 * @Date 2022/4/23 18:09
 * @Version 1.0
 */
@Data
@AllArgsConstructor
@NoArgsConstructor
public class Student {
 private String name;
 private Integer id;

 @Override
 public boolean equals(Object o) {
  if (this == o) return true;
  if (o == null || getClass() != o.getClass()) return false;
  Student student = (Student) o;
  return Objects.equals(name, student.name) ;
 }

 @Override
 public int hashCode() {
  return Objects.hash(name, id);
 }
}
